#include <iostream>
#include <stdlib.h>
#include <time.h>
#include "queue.h"
using namespace std;


int main()
{
    Queue Line1,Line2,Line3;
	void Addline(Queue &, Queue &);
	void sep();

	srand(time(NULL));

	cout << "ALL LINE ARE EMPTY!\n";
	cout << "Line1 = " << Line1 << endl;
	cout << "Line2 = " << Line2 << endl;
	cout << "Line3 = " << Line3 << endl; 

	Addline(Line1,Line2);

	sep();
	cout << "Add to lines 1 & 2\n";
	cout << "Line1 = " << Line1 << endl;
	cout << "Line2 = " << Line2 << endl;
	cout << "Line3 = " << Line3 << endl; 

	sep();
	cout << "Customer Checked Out Line1:" << --Line1 << " items\n";
	cout << "Customer Checked Out Line2:" << --Line2 << " items\n";

	sep();
	cout << "After checkouts for Line1 & Line2\n";
	cout << "Line1 = " << Line1 << endl;
	cout << "Line2 = " << Line2 << endl;
	

	Line1 += Line2;
	sep();
	cout << "Line1 +=Line2\n";
	cout << "Line1 = " << Line1 << endl;
	cout << "Line2 = " << Line2 << endl;

	Addline(Line1,Line2);


	sep();
	cout << "Before Addition\n";
	cout << "Line1 = " << Line1 << endl;
	cout << "Line2 = " << Line2 << endl;

	if (Line1 < Line2)
    {	cout << "Line3 = Line1 + Line2\n";
        Line3 = Line1 + Line2;
    }
	else
    {	cout << "Line3 = Line2 + Line1\n";
        Line3 = Line2 + Line1;
    }
	cout << "After Addition\n";
	cout << "Line1 = " << Line1 << endl;
	cout << "Line2 = " << Line2 << endl;
	cout << "Line3 = " << Line3 << endl; 

	sep();
	cout << "fin!" << endl;

    return 0;
}

void Addline(Queue &Line1,Queue &Line2)
{
	int Num = 0;

	Num = 2 + rand() % 5;
	for (int i = 1; i <= Num; i++)
		Line1 += i;

	Num = 2 + rand() % 5;
	for (int j = 1; j <= Num; j++)
		Line2 += j + 10;

}
void sep()
{
	cout << "\n\n--------------------------------------\n";
}


